<?php

class Core_Action_Admin_System_Appearance_Section_Index extends Action_Admin
{

	function initiator()
	{
		parent::initiator();
		
		Agilet::setVar(array(
			'page-title' => 'Manage Section',
			'toolbar' => 'admin/system/appearance/section',
			'breadcrum' => array(
				array(
					'url' => 'admin/system',
					'label' => 'System'
				),
				array(
					'url' => 'admin/system/appearance',
					'label' => 'Appearance'
				),
				array(
					'url' => 'admin/system/appearance/section',
					'label' => 'Section'
				),
			)
		));
	}

	public function execute($request, $initial = false, $script = null)
	{
		$table = Model::getTable('core/appearance/section');

		$select = $table -> select();
		
		$items = Paging::factory($select, $request -> getParam('page'));

		$request -> response = View::render($script = 'core/html/admin/system/appearance/section/index', $data = array('items' => $items, ));
	}

}
